﻿<vsx.ui:DialogWindow x:Class="Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Views.SolutionConfigurationEditorWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:vsx.ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.10.0"
                     xmlns:local.views="clr-namespace:Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Views"
                     x:Name="this"
                     Title="Code Analysis Configuration Editor"
                     WindowStartupLocation="CenterOwner"
                     MinHeight="400" Height="400" MinWidth="400" Width="400">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TabControl Grid.Row="0">
            <TabItem Header="General" DataContext="{Binding GenericConfiguration}">
                <Grid Margin="5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <CheckBox Grid.Row="0" IsChecked="{Binding EnableSearchGac}" Margin="5">Search Global Assembly Cache for missing references</CheckBox>
                    <CheckBox Grid.Row="1" IsChecked="{Binding IgnoreGeneratedCode}" Margin="5">Suppress analysis results against generated code</CheckBox>
                    <TextBlock Grid.Row="2" Margin="5,10,5,5">Timeout for analysis deadlock detection</TextBlock>
                    <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="20,0,0,5">
                        <Slider Minimum="{Binding MinimumTimeout}" Maximum="{Binding MaximumTimeout}" Value="{Binding Timeout}" TickFrequency="30" TickPlacement="TopLeft" Width="250"/>
                        <TextBlock Text="{Binding Timeout}" Margin="5,0"/>
                    </StackPanel>
                    <TextBlock Grid.Row="4" Margin="5,10,5,5">Analyze code with RuleSet</TextBlock>
                    <StackPanel Grid.Row="5" Orientation="Horizontal" Margin="20,0,0,5">
                        <ComboBox ItemsSource="{Binding RuleSets}" DisplayMemberPath="Name" SelectedValuePath="Path" SelectedValue="{Binding RuleSet}" ToolTip="{Binding SelectedItem.Name, RelativeSource={x:Static RelativeSource.Self}}" Width="210"/>
                        <Button Command="{Binding BrowseRuleSetCommand}" Width="60" Margin="5,0">Browse</Button>
                    </StackPanel>
                </Grid>
            </TabItem>
            <TabItem Header="Filter" DataContext="{Binding FilterConfiguration}">
                <Grid Margin="5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <DataGrid Grid.Row="1" ItemsSource="{Binding FilterPatterns}" AutoGenerateColumns="False" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray" CellEditEnding="OnCellEditEnding">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Value}" Header="Filter Pattern" Width="340"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
        </TabControl>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button IsDefault="True" Margin="5" Width="60" Command="{Binding SaveCommand}">Save</Button>
            <Button IsCancel="True" Margin="5" Width="60" Command="{Binding CancelCommand}">Cancel</Button>
        </StackPanel>
    </Grid>
</vsx.ui:DialogWindow>
